<template>
  <div id="app">
    <RootView v-if="type==1"/>
	<Login v-if="type==0"></Login>
  </div>
</template>

<script>
let timer = null
import RootView from './components/Root.vue'
import Login from './components/login.vue'
import {zh} from '/utilis/common.js'
export default {
  name: 'app',
  data() {
  	return {
		type:0
	}
  },
  components: {
    RootView,Login
  },
  created() {
  	this.getLogin()
	timer = setInterval(()=>{
		if(this.type == 0){
			this.getLogin()
		}else{
			clearInterval(timer)
		}
	},500)
  },
  methods:{
	  getLogin(){
		  if(!localStorage.getItem('is_login')){
		  	this.type = 0
		  	return false;
		  }
		  if(localStorage.getItem('is_login')){
		  	let name = localStorage.getItem('name');
		  	if(name != zh){
		  		this.type = 0
		  		return false;
		  	}else{
				this.type = 1
			}
		}
	  }
  }
}
</script>

<style>
	@import url("../public/font.css");
	*{
		margin: 0;
		padding: 0;
		box-sizing: border-box;
		font-family: 'ukjTor';
	}
	.rtl{
		direction: rtl;
	}
	.el-alert__content{
		text-align: center!important;
	}
	.el-alert__title{
		font-size: 18px!important;
		
	}
	.el-alert__description{
		margin-top: 15px!important;
		font-size: 15px!important;
		color: #999!important;
	}
	.el-textarea__inner{
		font-size: 18px!important;
		line-height: 30px!important;
		text-align: justify!important;
	}
</style>
